Add test for #155
authorJustin Burkett <justin@burkett.cc>
Wed, 30 Nov 2016 13:39:52 +0000 (08:39 -0500)
committerJustin Burkett <justin@burkett.cc>
Wed, 30 Nov 2016 13:40:19 +0000 (08:40 -0500)
which-key-tests.el

index 244992df16a1eeba9fbecc673590b96653a95a4e..4fcbf39538586b36ef6184dd2c95778de5813cbc 100644 (file)
@@ -52,6 +52,7 @@
            (("C-c .+" . nil) . ("C-c *" . "c-c *")))))
     (which-key-add-key-based-replacements
       "C-c ." "test ."
+      "SPC ." "SPC ."
       "C-c \\" "regexp quoting"
       "C-c [" "bad regexp")
     (should (equal
              (which-key--maybe-replace '("C-c b" . "test"))
              '("C-c a" . "c-c a")))
     (should (equal
-             (which-key--maybe-replace '("C-c ." "not test ."))
+             (which-key--maybe-replace '("C-c ." "not test ."))
              '("C-c ." . "test .")))
     (should (not
              (equal
-              (which-key--maybe-replace '("C-c +" "not test ."))
+              (which-key--maybe-replace '("C-c +" "not test ."))
               '("C-c ." . "test ."))))
     (should (equal
-             (which-key--maybe-replace '("C-c [" "orig bad regexp"))
+             (which-key--maybe-replace '("C-c [" "orig bad regexp"))
              '("C-c [" . "bad regexp")))
     (should (equal
-             (which-key--maybe-replace '("C-c \\" "pre quoting"))
-             '("C-c \\" . "regexp quoting")))))
+             (which-key--maybe-replace '("C-c \\" . "pre quoting"))
+             '("C-c \\" . "regexp quoting")))
+    ;; see #155
+    (should (equal
+             (which-key--maybe-replace '("SPC . ." . "don't replace"))
+             '("SPC . ." . "don't replace")))))
 
 (provide 'which-key-tests)
 ;;; which-key-tests.el ends here